< previous page page_558 next page >

Page 558
Type.gifListing 14.13. Adding code to the Declaration section of the errHandler class.
Option Explicit

'
' error types
Enum errType
    erritem = 0
    errcoll = 1
End Enum

'
' return/option values
Enum errReturn
    errExit = 0
    errresume = 1
    errNext = 2
    errselect = 3
End Enum

'
' handler storage
Private errDefRtn As errReturn
Private errDefType As errType
'
The first two items in the declaration section define enumerated types. These are a special type of user-defined type that are a mix between a standard user-defined type and a Public constant. Enumerated types make it easy to write well-documented code. Along with the enumerated types, you see two Private variables declared for local use.
Next, you need to add some declaration code to the BAS module in your DLL project. This code defines a special custom data type that you can use to control the display of your custom error dialog box. The errHandler DLL allows you to access any possible help topics associated with the error messages, too. For this reason, the BAS module contains the WinHelp API declaration. This is used on the custom dialog box. Open the BAS module, set its Name property to modErrHandler and enter the code in Listing 14.14 into the general declaration section of the module.
Type.gifListing 14.14. Adding code to the general declaration section of the modErrHandler BAS module.
Option Explicit

'
' define dialog data type
Public Type errDialog

 
< previous page page_558 next page >

If you like this book, buy it!